Xbasic

Formatting Functions

Description

Functions to format strings.

Name
Description
*ADDSLASHES Function

Quotes a BLOB (escapes NIL characters) -- allows user to chose what to escape and what to replace with.

*concat_keys Function

Concatenates key expressions, keeping the result under the MAXIMUM index key length, and eliminating 'blank' space from the end of keys.

*grouping_format_get Function

Dump grouping structure using a format.

*if_error Function

Adds error checking around an expression - if there is an error in the expression, the errorValue is returned.

a5_addtrailingbackslash Function

Adds a trailing backslash to a string if it does not already have one

a5_changeorderoflist Function

Allows a user to re-order a crlf delimited list of values.

a5_code_format Function

Indent code appropriately

a5_pad_leading_tabs Function

Inserts leading tabs in front of each line of a crlf delimited string

a5_popuptexteditor Function

Popup editor to edit text strings

a5_remove_curly_brackets Function

Remove curly brackets from a string

a5_remove_quotes Function

Unquotes string if string is quoted, else does nothing.

a5_removetrailingbackslash Function

Removes a trailing backslash to a string if it has one

a5_unsquare Function

Removes [ ] from a crlf delimited string. Useful when using the <array>.Matching() method

ALIGN_LEFT Function

Align text with left border

ALLTRIM Function

Trims leading and trailing spaces.

CASE Function

Returns the corresponding value for the first condition that evaluates to true (.t.)

DELIVERY_CODE Function

Computes the two digit delivery code for UPC codes

IIF Function

Tests an expression and returns one of two expressions.

jsescapequotes Function

Escape single and double quotes within an string for use within JavaScript

LTRIM Function

Removes any leading blanks (or optional other characters) in a character string.

PADC Function

Pads both sides of a string with another string.

PADL Function

Pads the left side of a string with another string.

PADR Function

Pads the right side of a string with another string.

profiler_format Function

Format and return a string with summaries of the profiling data collected so far.

QUOTE Function

Returns the quoted value - useful for expressions generating other expressions.

RAND_STRING Function

Returns a random character string of Length characters.

regex_literal_insert Function

Insert the literal characters into an undecorated string.

REPLICATE Function

Duplicates a character a specified number of times.

RIGHT Function

Returns a portion of a string starting with the rightmost character.

RTRIM Function

Remove trailing blanks (or optional other characters) from a character string.

savestringtofile Function

Save a string to a file. Return a callresult

SPACE Function

Returns a character string containing a specified number of spaces.

TRANSFORM Function

Returns a character string that formats a user defined expression.

TRIM Function

Removes trailing blanks from a character string.

UN_PAREN Function

Removes unnecessary enclosing parentheses from an expression. If paren are unbalanced, returns string

UNMASK Function

Extract characters that match placeholder space charaters of template.

unquote Function

Remove quotes from a string.

UNQUOTE2 Function

Removes wrapping quotes and converts escaped quotes to simple quotes.

WORD_WRAP Function

Convert a string to length limited lines, wrapping at the last full word.

Related Functions

*TREE_FROM_OUTLINE() - Converts an indented list into data formatted for display in a tree control.

*TREE_TO_OUTLINE() - Converts data formatted for a tree control into an indented list.

ALLTRIM() - Removes leading and trailing blanks from a Input_String.

FORMAT_DATA() - Formats a character, date, numeric, or logical value.

LEFT() - Returns a character string containing the specified Number_Of_Characters starting from the left-most character of the Input_String.

LTRIM() - Removes any specified leading characters in the Input_String.

OEM_TO_ANSI() - Converts characters from the OEM (DOS) character set to the ANSI (Windows) character set.

QUOTE() - Inserts quotes around Input_String.

REGEX_ESCAPE() - Formats data for processing by REGEX functions.

REMSPECIAL() - Strips all non-alphabetic and non-numeric characters, including spaces, from a string.

RTRIM() - Removes any specified trailing characters in the Input_String.

S_QUOTE() - Quotes and formats data for use in expressions.

STR() - Converts a Number to a right-justified character string.

STUFF() - Alters Input_String by replacing the specified Number_Of_Characters, beginning at the specified Starting_Position, with the Insert_String.

TAGGED_PATTERN() - Parses the Input_String (into "tags", or "fields") using the format specified by the Input_Format string and creates a formatted character string based on the format specified by Output_Format.

UNQUOTE2() - Removes one level of quotation marks, but never removes the last level, which is necessary for character string data.

UT() - Converts all the text to uppercase, and removes trailing blanks from a Input_String.

WORD_TAGGED_PATTERN() - Parses each "word" (or "record") in the input string (into "tags", or "fields") using the format specified by the Input_String string and creates an output result string based on the format specified by Output_Format.

ZBLANK() - Converts a Number to a formatted right justified character string.

See Also